package com.fudan.dto.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.fudan.tool.IdHelper;

public class Question implements Serializable{
	private Integer questionId;
	private String question;
	private User createdOwner;
	private Set<User> likeUser = new HashSet<User>();
	/**It is used in UI to disable/enable like button*/
	private boolean isLiked =false;
	private Date createdDate = new Date();
	
	public Question() {
		super();
	}


	public Question(String question, User createdOwner) {
		this.question = question;
		this.createdOwner = createdOwner;
	}
	

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public User getCreatedOwner() {
		return createdOwner;
	}

	public void setCreatedOwner(User createdOwner) {
		this.createdOwner = createdOwner;
	}

	public Integer getQuestionId() {
		return questionId;
	}

	public void setQuestionId(Integer questionId) {
		this.questionId = questionId;
	}

	public Set<User> getLikeUser() {
		return likeUser;
	}

	public void setLikeUser(Set<User> likeUser) {
		this.likeUser = likeUser;
	}

	public boolean isLiked() {		
		return isLiked;
	}

	public void setLiked(boolean isLiked) {
		this.isLiked = isLiked;
	}
	
	public long getCreatedDateLong() {
		return createdDate.getTime();
	}

	@Override
	public String toString() {
		return "Question [questionId=" + questionId + ", question=" + question + ", createdOwner=" + createdOwner
				+ ", likeUser=" + likeUser + ", isLiked=" + isLiked + ", createdDate=" + createdDate + "]";
	}
	

}
